package cn.zjitc.ptaLearn.ch07.ex06;

import java.util.Scanner;

/**
 * @author Zixuan Xu
 * @date
 */
/*
（1）经理（Manager）——每月获得一份固定的工资
（2）销售人员（Salesman）——在基本工资的基础上每月还有销售提成
（3）一般工人（Worker）——则按他每月工作的天数计算工资
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Employee e1 = new Manager(sc.nextInt());
        e1.getSalary();

        Employee e2 = new Salesman(sc.nextInt(),sc.nextInt());
        e2.getSalary();

        Employee e3 = new Worker(sc.nextInt(),sc.nextInt());
        e3.getSalary();
    }
}

abstract class Employee {
   // public void getSalary();
    abstract void getSalary();
}

class Manager extends Employee{
    int salary;

    public Manager(int salary) {
        this.salary = salary;
    }

    @Override
    public void getSalary() {
        System.out.println(salary);
    }

    /*public void getSalary(int salary) {
        System.out.println(salary);
    }*/
}

class Salesman extends Employee{
    int salary;
    int commission;

    public Salesman(int salary, int commission) {
        this.salary = salary;
        this.commission = commission;
    }
    @Override
    public void getSalary() {
        System.out.println(salary+commission);
    }
}

class Worker extends Employee{
    int salary;
    int day;

    public Worker(int salary, int day) {
        this.salary = salary;
        this.day = day;
    }
    @Override
    public void getSalary() {
        System.out.println(salary*day);
    }
}